package com.lzh.persevere.model.entity;

import com.baomidou.mybatisplus.annotation.TableName;
import com.lzh.persevere.common.BaseEntity;
import lombok.*;
import lombok.experimental.Accessors;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 评论表(Comment)表实体类
 *
 * @author luzhiheng
 * @since 2025-07-07
 */
@EqualsAndHashCode(callSuper = true)
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("comment")
@Builder
@Accessors(chain = true)
@Entity
@Table(name = "comment", indexes = {})
public class Comment extends BaseEntity {

    /**
     * 模块ID
     */
    @Column(name = "module_id", columnDefinition = "varchar(255) COMMENT '模块ID'")
    private String moduleId;

    /**
     * 根评论ID：为空表示顶级评论；不为空表示顶级评论ID
     */
    @Column(name = "root_comment_id", columnDefinition = "bigint COMMENT '根评论ID：为空表示顶级评论；不为空表示顶级评论ID'")
    private Long rootCommentId;

    /**
     * 回复目标评论ID
     */
    @Column(name = "to_comment_id", columnDefinition = "bigint COMMENT '回复目标评论ID'")
    private Long toCommentId;

    /**
     * 回复的用户ID
     */
    @Column(name = "to_comment_user_id", columnDefinition = "bigint COMMENT '回复的用户ID'")
    private Long toCommentUserId;

    /**
     * 评论内容
     */
    @Column(name = "content", columnDefinition = "varchar(1024) COMMENT '评论内容'")
    private String content;

    /**
     * 点赞次数
     */
    @Column(name = "like_count", columnDefinition = "int default '0' COMMENT '点赞次数'")
    private Integer likeCount;

    /**
     * 点踩次数
     */
    @Column(name = "dislike_count", columnDefinition = "int default '0' COMMENT '点踩次数'")
    private Integer dislikeCount;

    /**
     * IP地址
     */
    @Column(name = "ip", columnDefinition = "varchar(255) COMMENT 'IP地址'")
    private String ip;

    /**
     * 子集评论数
     */
    @Column(name = "sub_comment_count", columnDefinition = "int default '0' COMMENT '子集评论数'")
    private Integer subCommentCount;

    /**
     * 图片评论
     */
    @Column(name = "images", columnDefinition = "varchar(1024) COMMENT '图片评论'")
    private String images;

}

